import request from './request.js'


const header = {
	"tenant-id": "1",
	// 设置后端需要的传参类型
	"Content-Type": "application/json",
	// Authorization: "Bearer " + uni.getStorageSync("clientAccessToken"),
	Authorization: "Bearer " + '7606cd9099814eb1a022c954eff2595c',
	//   clientId: "8fc0edeb27d9154f54f69ae1fa10ec65",
	// "X-Requested-With": "XMLHttpRequest",
	withCredentials: false,
	terminal: 1,
}


const getActive = (params) => {
	return request("/app-api/promotion/reservation-activity/page?pageNo=" + params.pageNo + '&pageSize=' +
		params.pageSize + '&status=' + params.status, 'GET')
}

const postActiveOrder = (data) => {
	return request("/app-api/promotion/reservation-record/create", data, 'POST')
}

const acitveOrderDetail = (data) => {
	return request("/app-api/promotion/reservation-record/get?id="+data.id, 'GET')
}

const updateActiveOrder = (data) => {
	return request("/app-api/promotion/reservation-record/update" ,data, 'PUT')
};

const getAcitveOrder = (data) => {
	return request("/app-api/promotion/reservation-record/page?pageNo=" + data.pageNo + '&pageSize=' +
		data.pageSize , 'PUT')
};

export {
	getActive,
	postActiveOrder,
	acitveOrderDetail,
	updateActiveOrder,
	getAcitveOrder
}